package fr.lip6.meta.ple.plextraction;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.eclipse.emf.ecore.EObject;

import artefact.generic.Artefact;
import fr.lip6.meta.tools.SequenceConstructionGenerator;
import fr.lip6.meta.tools.UMLLoader;



public class MainTestCaseBank {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		System.out.println("Test");
		ArrayList<Artefact> artefacts = new ArrayList<Artefact>();
		
		
		for (int i=1; i<=4  ;i++) {
			SequenceConstructionGenerator mygen = new SequenceConstructionGenerator();
			UMLLoader myloader = UMLLoader.getInstance();
			String fileName = "generated/bank/BS"+i+".uml";
			List<EObject> resList = null;
			
			File f = new File(fileName);
			try {
				/** CHARGER UN MODEL D'UN FICHIER XMI **/
				System.out.println("Loading UML from file " + fileName);
				resList = myloader.loadUMLFromFile(f);
				System.out.println("Generating code...");
				mygen.generate(resList);

			} catch (IOException e) {
				e.printStackTrace();
			}
			Artefact   ar = mygen.getProduct();
			ar.setId(i);
			artefacts.add(ar);


		}
			
		//Extract.extract(ExampleClassDiagramCreation.createBankClassDiagrams());
		//Extract.extract(artefacts,"bank");
		System.out.println("Fin");


	}

}
